#ifndef __GLF_TASK_TASKTHREAD_DECL_H_INCLUDED__
#define __GLF_TASK_TASKTHREAD_DECL_H_INCLUDED__

namespace glf {

struct null_t;
class TaskCondition;

class TaskThreadImpl : public Thread
{
public:

	TaskThreadImpl();
	~TaskThreadImpl();

	bool IsActive();
	void Stop();

	void SetTaskCondition(TaskCondition& tc);

private:

	static const int THREAD_STACK_SIZE = 64 * 1024; 

	bool m_Active;
	TaskCondition* m_Tc;
};

template<typename Tag1, typename Tag2>
class TaskThread : public TaskThreadImpl
{
public:

	TaskThread(void*);
	virtual ~TaskThread();

	virtual void Run();
};

template<typename Tag1>
class TaskThread<Tag1, null_t> : public TaskThreadImpl
{
public:

	TaskThread(void*);
	virtual ~TaskThread();

	virtual void Run();
};

} // end namespace glf

#endif // __GLF_TASK_TASKTHREAD_DECL_H_INCLUDED__
